Conventional copiers, digital copiers in particular, offer various features for image editing in reproducing a document. These features may include magnification, reduction, erasing of selected areas, image shift and repeat, creation of textural patterns, color creation, and color conversion. For example, a conventional color copier can enable a user to designate a color in the document and convert this designated color to another color. With the color conversion function, the user selects a source color and a destination color such that the reproduced document will have all areas corresponding to the source color changed to the destination color. In a conventional digital copier, there may be a choice of retaining the source area gradation or not. The gradation mode is appropriate for pictorial images, while gradation can be excluded when constant colors are used; i.e., in business graphics.
Color conversion involves the detection of pixels whose color is close to that of the selected source color and subsequently changes the source color to the user selected destination color. The color video data from a scanner is usually in the form of red, green and blue (RGB) intensity. In order to identify pixels belonging to a particular color, it is possible to check the RGB values directly. However, simply checking the RGB values to identify pixels of a certain color and perform changes therefrom is not always satisfactory.
Conventionally, color conversion operations have preferred to identify the particular color by studying the hue, chroma, and lightness of the color after converting the RGB values to a hue, chroma, and lightness space. Color spaces of this nature include the Munsell color specification, HSV, HLS (a space used in computer graphics), HSI (a color spaced used in image processing), and L.sup.* C.sup.* h which is a polar coordinate formed of L.sup.* a.sup.* b.sup.*.
Hue is defined generically by the common term color. In other words, such common terms as red, yellow, green, and blue refer to hue. It is generally represented as an angular coordinate in the hue/chroma/lightness color space. The vividness or dullness of a color is described by saturation or chroma. In other words, chroma or saturation indicates how close a color is either to gray or to its pure hue. It is represented as a radial coordinate in the hue/chroma/lightness color space. The chroma changes on a horizontal plane with the gray at the center and the colors becoming more vivid as the chroma value moves outwardly in each hue direction. The vertical dimension in the hue/chroma/lightness space is the lightness or intensity. This value refers to the luminous intensity with black and white at the extremes.
To perform color conversion, the RGB values of a color are converted to the corresponding hue, chroma, and lightness representation. Upon color detection, the hue, chroma, and lightness values of the scanned color are converted to the hue, chroma and lightness values of a new destination color. The converted hue, chroma and lightness values can be transformed back to RGB values or the CMYK values for color output to a printer. An example of such a system is disclosed in U.S. Pat. No. 4,500,919 to Schreiber.
One version of color conversion is the monochrome mode. In this mode, an entire document is reduced to gray or a single hue. To obtain gray output, the chroma value of all pixels are changed to zero and the hue value becomes undefined while the lightness value remains unchanged. Such a monochrome mode method is illustrated in FIG. 1.
In conventional non-monochrome color conversion systems, only those pixels that have a color value close to the user selected source color are changed. Thus, it is necessary to check if a pixel is in the vicinity of the selected source color. If the pixel is in the vicinity of the selected source color, the appropriate color change is applied to that pixel. The actual color conversion process depends upon the selected source and destination color and can be separated into color to color, color to gray, and gray to color modes. The user can also select between a gradation mode and a no gradation mode. A gradation mode retains the shading of the source area in the output, while a no gradation mode renders a constant color.
In the following discussions, h.sub.s, C.sup.*.sub.s, L.sup.*.sub.s, and h.sub.d, C.sup.*.sub.d and L.sup.*.sub.d denote the hue, chroma, and lightness values of the user selected source and destination colors, respectively. The symbols h, C.sup.*, L.sup.*, and h', C.sup.* ', L.sup.* ', denote the pixel values before and after the color conversion process. The gray to color conversion mode requires the user to specify the L.sup.*.sub.max, and C.sup.*.sub.max limits so as to define the source gray pixels. The color to color and color to gray conversion modes may require the user to specify the source color range in hue angles, h.sub.min =h.sub.s -dh, h.sub.max =h.sub.s +dh, and a minimum chroma value, C.sup.*.sub.min. The hue angles h.sub.min and h.sub.max, define a hue window a half width dh. An example of a hue window is illustrated in FIG. 2. It is noted that h.sub.max &gt;h.sub.min is the usual case with respect to a hue window. However, if the hue window straddles the zero degree angle, h.sub.max will be less than h.sub.min.
The hue angle is defined in the range from 0.degree. to 360.degree.. Thus, the hue value of the pixel needs to be normalized. In the normalization process, the following routines are carried out until h is within the range of 0.degree. to 360.degree.. if h is less than 0.degree., h=h+360.degree., and if h is greater than or equal to 360.degree., h=h-360.degree..
For the gray to color mode, the chroma of a pixel needs to be checked against an upper bound C.sup.*.sub.max to insure that the pixel under consideration is gray and is within the specified lightness range. If the pixel in question is a gray pixel, the hue and chroma are changed to that of the selected destination color and the lightness value change would depend upon the choice of gradation.
For the color to gray mode, the color detection consists of checking if the hue is within the window of the source color. Once the pixel is determined to be within the hue window of the source color, the chroma value of the pixel in question may be checked against a lower limit chroma value C.sup.*.sub.min to insure that it is not a gray pixel. Once the pixel is determined to be equivalent to a source pixel, the identified pixel has its chroma value set to zero and its hue value becomes undefined.
The color to color mode requires a slightly different process. For the color to color mode, the color detection consists of checking if the hue is within the window of the source color. Once the pixel is determined to be within the hue window of the source color, the chroma value of the pixel in question may be checked against a lower limit chroma value C.sup.*.sub.min to insure that it is not a gray pixel. Once the pixel is determined to be equivalent to a source pixel, the gradation mode is checked. If there is no gradation mode, the color to color mode process sets the hue, chroma, and lightness values of the pixel to that of the destination color. For the gradation mode, the conventional device sets the hue value to that of the destination color while maintaining the chroma and lightness values unchanged to provide gradation.
An example of a conventional device for converting one color to another color is described in U.S. Pat. No. 4,972,257, issued on Nov. 20, 1990, entitled "Operator Adjustable Color Image Processing." This U.S. Patent discloses a device which allows a user to convert an image of one color to the same image having a new color. During the conversion process, the conversion of the hue, saturation, and lightness properties are adjusted manually by the operator. In other words, once the color of the pixel in question is determined to be equivalent to the source color, the image data of the pixel is converted to a predetermined hue value, a predetermined saturation value, and a predetermined lightness value. The establishment of the predetermined values is not dependent upon the saturation (chroma) or lightness (intensity) values of either the source color, the destination color, or the color of the pixel in question because the same predetermined saturation and lightness values are generated for each conversion process, only the hue values change from conversion process to conversion process. After establishing the hue, saturation, and lightness values, the operator adjusts these various values to realize the desired color and gradation.
Another example for converting one color to another color is illustrated in FIG. 3. In FIG. 3, it is determined at step S10 whether the incoming pixel value is a gray source. If the pixel value in question is a gray source, step S11 determines whether the pixel value has a chroma value less than the maximum chroma value (C.sup.*.sub.max). If the chroma value of the pixel in question is not less than C.sup.*.sub.max, step S19 establishes the hue, chroma, and lightness values to remain unchanged in the pixel in question.
However, if step S11 determines that the chroma value of the pixel in question is less than C.sup.*.sub.max, step S12 determines whether the lightness value of the pixel in questions is greater than a minimum lightness value (L.sup.*.sub.min) and less than a maximum lightness value (L.sup.*.sub.max). If this condition is not satisfied at step S12, the hue, chroma, and lightness values are established as described above with respect to step S19.
However, if the lightness value of the pixel in question does satisfy the conditions of step S12, step S13 determines whether a gradation mode has been selected. If a gradation mode has been selected, step S20 establishes the hue and chroma values to be the destination hue and chroma values while allowing the lightness value to remain unchanged. On the other hand, if step S13 determines that no gradation mode has been selected, step S14 establishes the hue, chroma, and lightness values to be the destination hue, chroma, and lightness values, respectively.
If step S10 determines that the source is not a gray source, step S15 determines whether the maximum hue value (h.sub.max) of the hue window is greater than or equal to the minimum hue value (h.sub.min) for the hue window. If h.sub.max is greater than h.sub.min, step S16 determines whether the hue value of the pixel in question is greater than h.sub.min of the hue window and less than h.sub.max of the hue window.
On the other hand, if step S15 determines that h.sub.max for the hue window is not greater than h.sub.min for the hue window, step S17 determines whether the hue value for the pixel in question is greater than h.sub.min for the hue window or less than h.sub.max for the hue window. If the hue value of the pixel in question does not meet the condition of step S16 or the condition of step S17, the hue, chroma, and lightness values are established as discussed above with respect to step S19.
However, if the hue value of the pixel in question meets the conditions of either step S16 or step S17, step S18 determines whether the chroma value of the pixel in question is greater than a minimum chroma value (C.sup.*.sub.min). If step S18 determines that the chroma value of the pixel in question is not greater than C.sup.*.sub.min, the hue, chroma, and lightness values remain unchanged as discussed above with respect to step S19. On the other hand, if the chroma value of the pixel in question is greater than C.sup.*.sub.min, step S21 determines whether the destination color is a gray destination.
If the destination color is a gray destination, step S22 determines whether a gradation mode has been selected. If a gradation mode has been selected, step S30 establishes the hue value as being undefined, the chroma value as being equal to zero, and allows the lightness value to remain unchanged. However, if step S22 determines that no gradation has been selected, step S23 establishes the hue value as being undefined, the chroma value as zero, and the lightness value as being equal to the destination lightness value.
On the other hand, if step S21 determines that the destination color is not a gray destination, step S24 determines whether a gradation mode has been selected. If no gradation mode has been selected, step S34 establishes the hue value as the destination hue value, the chroma value as the destination chroma value, and the lightness value as the destination lightness value. However, if a gradation has been selected in step S24, step S39 establishes the hue value as the destination hue value, while allowing the chroma value and the lightness value to remain unchanged.
Although conventional devices have a color conversion feature with gradation, the gradation is less than satisfactory in most instances. For example, in the method described with respect to FIG. 3, if the original color is different in saturation or lightness from the user selected destination color, the output color will not quite match the selected color. This problem is caused because the source color has different average chroma and lightness values from that of the destination color, and these values have not been changed. Moreover, simply setting the chroma and lightness values to that of the destination color will end up with a color to color conversion that contains no true gradation. This causes many problems when attempting to reproduce a high quality document having the original colors of the image converted to certain destination colors. On the other hand, U.S. Pat. No. 4,972,257, issued on Nov. 20, 1990, entitled "Operator Adjustable Color Image Processing" provides the operator with the opportunity to adjust the hue, saturation, and lightness values manually so as to match the desired destination color with the selected source color.
To realize a proper color to color conversion automatically so as to provide high speed copying without operator intervention while maintaining a true gradation capability, the system or method must be capable of internally and automatically adjusting the chroma and lightness values of the pixels in question such that the color conversion process can generate converted values which closely resemble the destination color.